luci-mod-system: fix JSMIN Error
authorAndy Chiang <[email protected]>
Mon, 20 Oct 2025 01:22:11 +0000 (08:22 +0700)
committerPaul Donald <[email protected]>
Mon, 20 Oct 2025 10:46:02 +0000 (12:46 +0200)
jsmin cannot handle regular expressions in this format, so use RegExp() instead.

fixes: #8020

Signed-off-by: Andy Chiang <[email protected]>
modules/luci-mod-system/htdocs/luci-static/resources/view/system/repokeys.js

index 6703a50970565300cb8b2f346c3b445586b77d6e..2b1b757198ce2e60679b24d3ab86cf13337cabdb 100644 (file)
@@ -117,7 +117,7 @@ function removeKey(ev) {
 }
 
 function isPemFormat(content) {
-       return /-BEGIN ([A-Z ]+)?PUBLIC KEY-/.test(content);
+       return new RegExp('-BEGIN ([A-Z ]+)?PUBLIC KEY-').test(content);
 }
 
 function keyEnvironmentCheck(key) {